<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use DB;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {

//        //        1 导航栏数据      $nav
//        $nav = Nav::orderBy('nav_order','asc')->take(7)->get();
//        //        4 最新文章   8篇  $news
//        $news = Article::orderBy('art_time','desc')->take(8)->get();
////        5 点击排行榜文章 5篇  $hot
//        $hot = Article::orderBy('art_view','asc')->take(5)->get();
//        view()->share('nav', $nav);
//        view()->share('news', $news);
//        view()->share('hot', $hot);
        $data = DB::table('imgs') -> get();
        view()->share('data', $data);

    }
   

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
